<!DOCTYPE HTML>
<html lang="zh-cn" class="light" dir="ltr">
    <head>
            <script type="text/x-mathjax-config">
                MathJax.Hub.Config({
                    showProcessingMessages: false,
                    messageStyle: "none",
                    extensions: ['tex2jax.js'],
                    jax: ['input/TeX', 'output/HTML-CSS'],
                    tex2jax: {
                        inlineMath: [ ['$','$'], ["\\(","\\)"] ],
                        displayMath: [ ['$$','$$'], ["\\[","\\]"] ],
                        processEscapes: true
                    },
                    "HTML-CSS": { availableFonts: ["STIX", "TeX"] }
                });
            </script>
            
        <!-- Book generated using mdBook -->
        <meta charset="UTF-8">
        <title>stdx.net.http - 仓颉编程语言扩展库 API</title>


        <!-- Custom HTML head -->
        
        <meta name="description" content="">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="theme-color" content="#ffffff">

        <link rel="icon" href="../../favicon.svg">
        <link rel="shortcut icon" href="../../favicon.png">
        <link rel="stylesheet" href="../../css/variables.css">
        <link rel="stylesheet" href="../../css/general.css">
        <link rel="stylesheet" href="../../css/chrome.css">
        <link rel="stylesheet" href="../../css/print.css" media="print">

        <!-- Fonts -->
        <link rel="stylesheet" href="../../FontAwesome/css/font-awesome.css">
        <link rel="stylesheet" href="../../fonts/fonts.css">

        <!-- Highlight.js Stylesheets -->
        <link rel="stylesheet" href="../../highlight.css">
        <link rel="stylesheet" href="../../tomorrow-night.css">
        <link rel="stylesheet" href="../../ayu-highlight.css">

        <!-- Custom theme stylesheets -->
        <link rel="stylesheet" href="../../assets/style.css">
        <link rel="stylesheet" href="../../assets/theme.css">

        <!-- MathJax -->
        <script async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
    </head>
    <body class="sidebar-visible no-js">
    <div id="body-container">
        <!-- Provide site root to javascript -->
        <script>
            var path_to_root = "../../";
            var default_theme = window.matchMedia("(prefers-color-scheme: dark)").matches ? "light" : "light";
        </script>

        <!-- Work around some values being stored in localStorage wrapped in quotes -->
        <script>
            try {
                var theme = localStorage.getItem('mdbook-theme');
                var sidebar = localStorage.getItem('mdbook-sidebar');

                if (theme.startsWith('"') && theme.endsWith('"')) {
                    localStorage.setItem('mdbook-theme', theme.slice(1, theme.length - 1));
                }

                if (sidebar.startsWith('"') && sidebar.endsWith('"')) {
                    localStorage.setItem('mdbook-sidebar', sidebar.slice(1, sidebar.length - 1));
                }
            } catch (e) { }
        </script>

        <!-- Set the theme before any content is loaded, prevents flash -->
        <script>
            var theme;
            try { theme = localStorage.getItem('mdbook-theme'); } catch(e) { }
            if (theme === null || theme === undefined) { theme = default_theme; }
            var html = document.querySelector('html');
            html.classList.remove('light')
            html.classList.add(theme);
            var body = document.querySelector('body');
            body.classList.remove('no-js')
            body.classList.add('js');
        </script>

        <input type="checkbox" id="sidebar-toggle-anchor" class="hidden">

        <!-- Hide / unhide sidebar before it is displayed -->
        <script>
            var body = document.querySelector('body');
            var sidebar = null;
            var sidebar_toggle = document.getElementById("sidebar-toggle-anchor");
            if (document.body.clientWidth >= 1080) {
                try { sidebar = localStorage.getItem('mdbook-sidebar'); } catch(e) { }
                sidebar = sidebar || 'visible';
            } else {
                sidebar = 'hidden';
            }
            sidebar_toggle.checked = sidebar === 'visible';
            body.classList.remove('sidebar-visible');
            body.classList.add("sidebar-" + sidebar);
        </script>

        <nav id="sidebar" class="sidebar" aria-label="Table of contents">
            <div class="sidebar-scrollbox">
                <ol class="chapter"><li class="chapter-item expanded "><a href="../../libs_overview.html"><strong aria-hidden="true">1.</strong> 仓颉编程语言扩展库 API</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../aspectCJ/aspectCJ_package_overview.html"><strong aria-hidden="true">1.1.</strong> stdx.aspectCJ</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../aspectCJ/aspectCJ_package_api/aspectCJ_package_classes.html"><strong aria-hidden="true">1.1.1.</strong> 类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.1.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../aspectCJ/aspectCJ_samples/aspectCJ_sample.html"><strong aria-hidden="true">1.1.2.1.</strong> aspecjCJ 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../compress/zlib/zlib_package_overview.html"><strong aria-hidden="true">1.2.</strong> stdx.compress.zlib</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../compress/zlib/zlib_package_api/zlib_package_classes.html"><strong aria-hidden="true">1.2.1.</strong> 类</a></li><li class="chapter-item "><a href="../../compress/zlib/zlib_package_api/zlib_package_enums.html"><strong aria-hidden="true">1.2.2.</strong> 枚举</a></li><li class="chapter-item "><a href="../../compress/zlib/zlib_package_api/zlib_package_exceptions.html"><strong aria-hidden="true">1.2.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.2.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../compress/zlib/zlib_samples/deflate_compress_decompress.html"><strong aria-hidden="true">1.2.4.1.</strong> Deflate 格式数据的压缩和解压</a></li><li class="chapter-item "><a href="../../compress/zlib/zlib_samples/gzip_compress_decompress.html"><strong aria-hidden="true">1.2.4.2.</strong> Gzip 格式数据的压缩和解压</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../crypto/crypto/crypto_package_overview.html"><strong aria-hidden="true">1.3.</strong> stdx.crypto.crypto</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/crypto/crypto_package_api/crypto_package_classes.html"><strong aria-hidden="true">1.3.1.</strong> 类</a></li><li class="chapter-item "><a href="../../crypto/crypto/crypto_package_api/crypto_package_structs.html"><strong aria-hidden="true">1.3.2.</strong> 结构体</a></li><li class="chapter-item "><a href="../../crypto/crypto/crypto_package_api/crypto_package_exceptions.html"><strong aria-hidden="true">1.3.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.3.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/crypto/crypto_samples/sample_secure_random.html"><strong aria-hidden="true">1.3.4.1.</strong> SecureRandom 使用</a></li><li class="chapter-item "><a href="../../crypto/crypto/crypto_samples/sample_crypto.html"><strong aria-hidden="true">1.3.4.2.</strong> SM4 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../crypto/digest/crypto_digest_package_overview.html"><strong aria-hidden="true">1.4.</strong> stdx.crypto.digest</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/digest/digest_package_api/digest_package_classes.html"><strong aria-hidden="true">1.4.1.</strong> 类</a></li><li class="chapter-item "><a href="../../crypto/digest/digest_package_api/digest_package_structs.html"><strong aria-hidden="true">1.4.2.</strong> 结构体</a></li><li class="chapter-item "><a href="../../crypto/digest/digest_package_api/digest_package_exceptions.html"><strong aria-hidden="true">1.4.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.4.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/digest/digest_samples/sample_digest.html"><strong aria-hidden="true">1.4.4.1.</strong> digest 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../crypto/keys/keys_package_overview.html"><strong aria-hidden="true">1.5.</strong> stdx.crypto.keys</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/keys/keys_package_api/keys_package_classes.html"><strong aria-hidden="true">1.5.1.</strong> 类</a></li><li class="chapter-item "><a href="../../crypto/keys/keys_package_api/keys_package_enums.html"><strong aria-hidden="true">1.5.2.</strong> 枚举</a></li><li class="chapter-item "><a href="../../crypto/keys/keys_package_api/keys_package_structs.html"><strong aria-hidden="true">1.5.3.</strong> 结构体</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.5.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/keys/keys_samples/sample_keys.html"><strong aria-hidden="true">1.5.4.1.</strong> keys 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_overview.html"><strong aria-hidden="true">1.6.</strong> stdx.crypto.x509</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_type.html"><strong aria-hidden="true">1.6.1.</strong> 类型别名</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_interfaces.html"><strong aria-hidden="true">1.6.2.</strong> 接口</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_classes.html"><strong aria-hidden="true">1.6.3.</strong> 类</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_enums.html"><strong aria-hidden="true">1.6.4.</strong> 枚举</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_structs.html"><strong aria-hidden="true">1.6.5.</strong> 结构体</a></li><li class="chapter-item "><a href="../../crypto/x509/x509_package_api/x509_package_exceptions.html"><strong aria-hidden="true">1.6.6.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.6.7.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../crypto/x509/x509_samples/sample_x509.html"><strong aria-hidden="true">1.6.7.1.</strong> x509 使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/base64/base64_package_overview.html"><strong aria-hidden="true">1.7.</strong> stdx.encoding.base64</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/base64/base64_package_api/base64_package_funcs.html"><strong aria-hidden="true">1.7.1.</strong> 函数</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.7.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/base64/base64_samples/base64.html"><strong aria-hidden="true">1.7.2.1.</strong> Byte 数组和 Base64 互转</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/hex/hex_package_overview.html"><strong aria-hidden="true">1.8.</strong> stdx.encoding.hex</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/hex/hex_package_api/hex_package_funcs.html"><strong aria-hidden="true">1.8.1.</strong> 函数</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.8.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/hex/hex_samples/hex.html"><strong aria-hidden="true">1.8.2.1.</strong> Byte 数组和 Hex 互转</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/json/json_package_overview.html"><strong aria-hidden="true">1.9.</strong> stdx.encoding.json</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/json/json_package_api/encoding_json_package_interfaces.html"><strong aria-hidden="true">1.9.1.</strong> 接口</a></li><li class="chapter-item "><a href="../../encoding/json/json_package_api/encoding_json_package_classes.html"><strong aria-hidden="true">1.9.2.</strong> 类</a></li><li class="chapter-item "><a href="../../encoding/json/json_package_api/encoding_json_package_enums.html"><strong aria-hidden="true">1.9.3.</strong> 枚举</a></li><li class="chapter-item "><a href="../../encoding/json/json_package_api/encoding_json_package_exceptions.html"><strong aria-hidden="true">1.9.4.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.9.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/json/json_samples/json_array_sample.html"><strong aria-hidden="true">1.9.5.1.</strong> JsonArray 使用示例</a></li><li class="chapter-item "><a href="../../encoding/json/json_samples/json_value_sample.html"><strong aria-hidden="true">1.9.5.2.</strong> JsonValue 和 String 互相转换</a></li><li class="chapter-item "><a href="../../encoding/json/json_samples/to_json_sample.html"><strong aria-hidden="true">1.9.5.3.</strong> JsonValue 与 DataModel 的转换</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_overview.html"><strong aria-hidden="true">1.10.</strong> stdx.encoding.json.stream</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_interfaces.html"><strong aria-hidden="true">1.10.1.</strong> 接口</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_classes.html"><strong aria-hidden="true">1.10.2.</strong> 类</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_enums.html"><strong aria-hidden="true">1.10.3.</strong> 枚举</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_package_api/encoding_json_stream_package_structs.html"><strong aria-hidden="true">1.10.4.</strong> 结构体</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.10.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_samples/sample_json_reader.html"><strong aria-hidden="true">1.10.5.1.</strong> 使用 Json Stream 进行反序列化</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_samples/sample_json_writer.html"><strong aria-hidden="true">1.10.5.2.</strong> 使用 Json Stream 进行序列化</a></li><li class="chapter-item "><a href="../../encoding/json_stream/json_stream_samples/sample_json_writeconfig.html"><strong aria-hidden="true">1.10.5.3.</strong> WriteConfig 使用示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../encoding/url/url_package_overview.html"><strong aria-hidden="true">1.11.</strong> stdx.encoding.url</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/url/url_package_api/url_package_classes.html"><strong aria-hidden="true">1.11.1.</strong> 类</a></li><li class="chapter-item "><a href="../../encoding/url/url_package_api/url_package_exceptions.html"><strong aria-hidden="true">1.11.2.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.11.3.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../encoding/url/url_samples/form.html"><strong aria-hidden="true">1.11.3.1.</strong> Form 的构造使用</a></li><li class="chapter-item "><a href="../../encoding/url/url_samples/url_parse.html"><strong aria-hidden="true">1.11.3.2.</strong> URL 解析函数 parse 的使用</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../fuzz/fuzz_package_overview.html"><strong aria-hidden="true">1.12.</strong> stdx.fuzz.fuzz</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../fuzz/fuzz_package_api/fuzz_package_constants_vars.html"><strong aria-hidden="true">1.12.1.</strong> 常量变量</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_package_api/fuzz_package_classes.html"><strong aria-hidden="true">1.12.2.</strong> 类</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_package_api/fuzz_package_exceptions.html"><strong aria-hidden="true">1.12.3.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.12.4.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../fuzz/fuzz_samples/basic_fuzzing_test.html"><strong aria-hidden="true">1.12.4.1.</strong> 测试猜测字符功能</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/dataprovider_usage.html"><strong aria-hidden="true">1.12.4.2.</strong> 使用 DataProvider 功能进行测试</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/fake_coverage_usage.html"><strong aria-hidden="true">1.12.4.3.</strong> 使用 FakeCoverage 避免 DataProvider 模式下 Fuzz 异常终止</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/print_cj-fuzz_usage.html"><strong aria-hidden="true">1.12.4.4.</strong> 打印 fuzz 使用方法</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/print_coverage.html"><strong aria-hidden="true">1.12.4.5.</strong> 实验性特性-覆盖率信息打印</a></li><li class="chapter-item "><a href="../../fuzz/fuzz_samples/stack_backtrace_missing_solution.html"><strong aria-hidden="true">1.12.4.6.</strong> 栈回溯缺失的处理方案</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../log/log_package_overview.html"><strong aria-hidden="true">1.13.</strong> stdx.log</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../log/log_package_api/log_package_types.html"><strong aria-hidden="true">1.13.1.</strong> 类型别名</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_funcs.html"><strong aria-hidden="true">1.13.2.</strong> 函数</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_interfaces.html"><strong aria-hidden="true">1.13.3.</strong> 接口</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_classes.html"><strong aria-hidden="true">1.13.4.</strong> 类</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_structs.html"><strong aria-hidden="true">1.13.5.</strong> 结构体</a></li><li class="chapter-item "><a href="../../log/log_package_api/log_package_exceptions.html"><strong aria-hidden="true">1.13.6.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.13.7.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../log/log_samples/log_sample.html"><strong aria-hidden="true">1.13.7.1.</strong> 日志打印示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../logger/logger_package_overview.html"><strong aria-hidden="true">1.14.</strong> stdx.logger</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../logger/logger_package_api/logger_package_classes.html"><strong aria-hidden="true">1.14.1.</strong> 类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.14.2.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../logger/logger_samples/logger_sample.html"><strong aria-hidden="true">1.14.2.1.</strong> 日志打印示例</a></li></ol></li></ol></li><li class="chapter-item expanded "><a href="../../net/http/http_package_overview.html" class="active"><strong aria-hidden="true">1.15.</strong> stdx.net.http</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_funcs.html"><strong aria-hidden="true">1.15.1.</strong> 函数</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_interfaces.html"><strong aria-hidden="true">1.15.2.</strong> 接口</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_classes.html"><strong aria-hidden="true">1.15.3.</strong> 类</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_enums.html"><strong aria-hidden="true">1.15.4.</strong> 枚举</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_structs.html"><strong aria-hidden="true">1.15.5.</strong> 结构体</a></li><li class="chapter-item "><a href="../../net/http/http_package_api/http_package_exceptions.html"><strong aria-hidden="true">1.15.6.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.15.7.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../net/http/http_samples/http_client.html"><strong aria-hidden="true">1.15.7.1.</strong> client</a></li><li class="chapter-item "><a href="../../net/http/http_samples/cookie.html"><strong aria-hidden="true">1.15.7.2.</strong> cookie</a></li><li class="chapter-item "><a href="../../net/http/http_samples/log.html"><strong aria-hidden="true">1.15.7.3.</strong> log</a></li><li class="chapter-item "><a href="../../net/http/http_samples/http_server.html"><strong aria-hidden="true">1.15.7.4.</strong> server</a></li><li class="chapter-item "><a href="../../net/http/http_samples/webSocket.html"><strong aria-hidden="true">1.15.7.5.</strong> webSocket</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../net/tls/tls_package_overview.html"><strong aria-hidden="true">1.16.</strong> stdx.net.tls</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../net/tls/tls_package_api/tls_package_classes.html"><strong aria-hidden="true">1.16.1.</strong> 类</a></li><li class="chapter-item "><a href="../../net/tls/tls_package_api/tls_package_enums.html"><strong aria-hidden="true">1.16.2.</strong> 枚举</a></li><li class="chapter-item "><a href="../../net/tls/tls_package_api/tls_package_structs.html"><strong aria-hidden="true">1.16.3.</strong> 结构体</a></li><li class="chapter-item "><a href="../../net/tls/tls_package_api/tls_package_exceptions.html"><strong aria-hidden="true">1.16.4.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.16.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../net/tls/tls_samples/cert_key.html"><strong aria-hidden="true">1.16.5.1.</strong> 服务端证书及公钥在一份文件中</a></li><li class="chapter-item "><a href="../../net/tls/tls_samples/client.html"><strong aria-hidden="true">1.16.5.2.</strong> 客户端示例</a></li><li class="chapter-item "><a href="../../net/tls/tls_samples/hot_update_cert.html"><strong aria-hidden="true">1.16.5.3.</strong> 证书热更新</a></li><li class="chapter-item "><a href="../../net/tls/tls_samples/server.html"><strong aria-hidden="true">1.16.5.4.</strong> 服务端示例</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../serialization/serialization_package_overview.html"><strong aria-hidden="true">1.17.</strong> stdx.serialization.serialization</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../serialization/serialization_package_api/serialization_package_functions.html"><strong aria-hidden="true">1.17.1.</strong> 函数</a></li><li class="chapter-item "><a href="../../serialization/serialization_package_api/serialization_package_interfaces.html"><strong aria-hidden="true">1.17.2.</strong> 接口</a></li><li class="chapter-item "><a href="../../serialization/serialization_package_api/serialization_package_classes.html"><strong aria-hidden="true">1.17.3.</strong> 类</a></li><li class="chapter-item "><a href="../../serialization/serialization_package_api/serialization_package_exceptions.html"><strong aria-hidden="true">1.17.4.</strong> 异常类</a></li><li class="chapter-item "><div><strong aria-hidden="true">1.17.5.</strong> 示例教程</div><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../serialization/serialization_samples/serialize_and_deserialize_class.html"><strong aria-hidden="true">1.17.5.1.</strong> class 序列化和反序列化</a></li><li class="chapter-item "><a href="../../serialization/serialization_samples/serialize_hashmap_and_hashset.html"><strong aria-hidden="true">1.17.5.2.</strong> HashSet 和 HashMap 序列化</a></li></ol></li></ol></li><li class="chapter-item "><a href="../../unittest/data/data_package_overview.html"><strong aria-hidden="true">1.18.</strong> stdx.unittest.data</a><a class="toggle"><div>❱</div></a></li><li><ol class="section"><li class="chapter-item "><a href="../../unittest/data/data_package_api/data_package_functions.html"><strong aria-hidden="true">1.18.1.</strong> 函数</a></li><li class="chapter-item "><a href="../../unittest/data/data_package_api/data_package_classes.html"><strong aria-hidden="true">1.18.2.</strong> 类</a></li></ol></li></ol></li></ol>
            </div>
            <div id="sidebar-resize-handle" class="sidebar-resize-handle">
                <div class="sidebar-resize-indicator"></div>
            </div>
        </nav>

        <!-- Track and set sidebar scroll position -->
        <script>
            var sidebarScrollbox = document.querySelector('#sidebar .sidebar-scrollbox');
            sidebarScrollbox.addEventListener('click', function(e) {
                if (e.target.tagName === 'A') {
                    sessionStorage.setItem('sidebar-scroll', sidebarScrollbox.scrollTop);
                }
            }, { passive: true });
            var sidebarScrollTop = sessionStorage.getItem('sidebar-scroll');
            sessionStorage.removeItem('sidebar-scroll');
            if (sidebarScrollTop) {
                // preserve sidebar scroll position when navigating via links within sidebar
                sidebarScrollbox.scrollTop = sidebarScrollTop;
            } else {
                // scroll sidebar to current active section when navigating via "next/previous chapter" buttons
                var activeSection = document.querySelector('#sidebar .active');
                if (activeSection) {
                    activeSection.scrollIntoView({ block: 'center' });
                }
            }
        </script>

        <div id="page-wrapper" class="page-wrapper">

            <div class="page">
                                <div id="menu-bar-hover-placeholder"></div>
                <div id="menu-bar" class="menu-bar sticky">
                    <div class="left-buttons">
                        <label id="sidebar-toggle" class="icon-button" for="sidebar-toggle-anchor" title="Toggle Table of Contents" aria-label="Toggle Table of Contents" aria-controls="sidebar">
                            <i class="fa fa-bars"></i>
                        </label>
                        <button id="theme-toggle" class="icon-button" type="button" title="Change theme" aria-label="Change theme" aria-haspopup="true" aria-expanded="false" aria-controls="theme-list">
                            <i class="fa fa-paint-brush"></i>
                        </button>
                        <ul id="theme-list" class="theme-popup" aria-label="Themes" role="menu">
                            <li role="none"><button role="menuitem" class="theme" id="light">Light</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="rust">Rust</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="coal">Coal</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="navy">Navy</button></li>
                            <li role="none"><button role="menuitem" class="theme" id="ayu">Ayu</button></li>
                        </ul>
                        <button id="search-toggle" class="icon-button" type="button" title="Search. (Shortkey: s)" aria-label="Toggle Searchbar" aria-expanded="false" aria-keyshortcuts="S" aria-controls="searchbar">
                            <i class="fa fa-search"></i>
                        </button>
                    </div>

                    <h1 class="menu-title">仓颉编程语言扩展库 API</h1>

                    <div class="right-buttons">
                        <a href="../../print.html" title="Print this book" aria-label="Print this book">
                            <i id="print-button" class="fa fa-print"></i>
                        </a>

                    </div>
                </div>

                <div id="search-wrapper" class="hidden">
                    <form id="searchbar-outer" class="searchbar-outer">
                        <input type="search" id="searchbar" name="searchbar" placeholder="Search this book ..." aria-controls="searchresults-outer" aria-describedby="searchresults-header">
                    </form>
                    <div id="searchresults-outer" class="searchresults-outer hidden">
                        <div id="searchresults-header" class="searchresults-header"></div>
                        <ul id="searchresults">
                        </ul>
                    </div>
                </div>

                <!-- Apply ARIA attributes after the sidebar and the sidebar toggle button are added to the DOM -->
                <script>
                    document.getElementById('sidebar-toggle').setAttribute('aria-expanded', sidebar === 'visible');
                    document.getElementById('sidebar').setAttribute('aria-hidden', sidebar !== 'visible');
                    Array.from(document.querySelectorAll('#sidebar a')).forEach(function(link) {
                        link.setAttribute('tabIndex', sidebar === 'visible' ? 0 : -1);
                    });
                </script>

                <div id="content" class="content">
                    <main>
                        <h1 id="stdxnethttp"><a class="header" href="#stdxnethttp">stdx.net.http</a></h1>
<h2 id="功能介绍"><a class="header" href="#功能介绍">功能介绍</a></h2>
<p>http 包提供 HTTP/1.1、HTTP/2 和 WebSocket 协议的 server、client 端实现。</p>
<p>关于协议的详细内容可参考 <a href="https://httpwg.org/specs/rfc9110.html">RFC 9110</a>、<a href="https://httpwg.org/specs/rfc9112.html">9112</a>、<a href="https://httpwg.org/specs/rfc9113.html">9113</a>、<a href="https://httpwg.org/specs/rfc9218.html">9218</a>、<a href="https://httpwg.org/specs/rfc7541.html">7541</a> 等。</p>
<p>使用本包需要外部依赖 <code>OpenSSL 3</code> 的 <code>ssl</code> 和 <code>crypto</code> 动态库文件，故使用前需安装相关工具：</p>
<ul>
<li>对于 <code>Linux</code> 操作系统，可参考以下方式：
<ul>
<li>如果系统的包管理工具支持安装 <code>OpenSSL 3</code> 开发工具包，可通过这个方式安装，并确保系统安装目录下含有 <code>libssl.so</code>、<code>libssl.so.3</code>、<code>libcrypto.so</code> 和 <code>libcrypto.so.3</code> 这些动态库文件，例如 <code>Ubuntu 22.04</code> 系统上可使用 <code>sudo apt install libssl-dev</code> 命令安装 <code>libssl-dev</code> 工具包；</li>
<li>如果无法通过上面的方式安装，可自行下载 <code>OpenSSL 3.x.x</code> 源码编译安装软件包，并确保安装目录下含有 <code>libssl.so</code>、<code>libssl.so.3</code>、<code>libcrypto.so</code> 和 <code>libcrypto.so.3</code> 这些动态库文件，然后可选择下面任意一种方式来保证系统链接器可以找到这些文件:
<ul>
<li>在系统未安装 OpenSSL 的场景，安装时选择直接安装到系统路径下；</li>
<li>安装在自定义目录的场景，将这些文件所在目录设置到环境变量 <code>LD_LIBRARY_PATH</code> 以及 <code>LIBRARY_PATH</code> 中。</li>
</ul>
</li>
</ul>
</li>
<li>对于 <code>Windows</code> 操作系统，可按照以下步骤：
<ul>
<li>自行下载 <code>OpenSSL 3.x.x</code> 源码编译安装 x64 架构软件包或者自行下载安装第三方预编译的供开发人员使用的 <code>OpenSSL 3.x.x</code> 软件包；</li>
<li>确保安装目录下含有 <code>libssl.dll.a</code>（或 <code>libssl.lib</code>）、<code>libssl-3-x64.dll</code>、<code>libcrypto.dll.a</code>（或 <code>libcrypto.lib</code>）、<code>libcrypto-3-x64.dll</code> 这些库文件；</li>
<li>将 <code>libssl.dll.a</code>（或 <code>libssl.lib</code>）、<code>libcrypto.dll.a</code>（或 <code>libcrypto.lib</code>）所在的目录路径设置到环境变量 <code>LIBRARY_PATH</code> 中，将 <code>libssl-3-x64.dll</code>、<code>libcrypto-3-x64.dll</code> 所在的目录路径设置到环境变量 <code>PATH</code> 中。</li>
</ul>
</li>
<li>对于 <code>macOS</code> 操作系统，可参考以下方式：
<ul>
<li>使用 <code>brew install openssl@3</code> 安装，并确保系统安装目录下含有 <code>libcrypto.dylib</code> 和 <code>libcrypto.3.dylib</code> 这两个动态库文件；</li>
<li>如果无法通过上面的方式安装，可自行下载 <code>OpenSSL 3.x.x</code> 源码编译安装软件包，并确保安装目录下含有 <code>libcrypto.dylib</code> 和 <code>libcrypto.3.dylib</code> 这两个动态库文件，然后可选择下面任意一种方式来保证系统链接器可以找到这些文件:
<ul>
<li>在系统未安装 OpenSSL 的场景，安装时选择直接安装到系统路径下；</li>
<li>安装在自定义目录的场景，将这些文件所在目录设置到环境变量 <code>DYLD_LIBRARY_PATH</code> 以及 <code>LIBRARY_PATH</code> 中。</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>如果未安装 <code>OpenSSL 3</code>软件包或者安装低版本的软件包，程序可能无法使用并抛出 TLS 相关异常。</p>
<h3 id="http"><a class="header" href="#http">http</a></h3>
<p>用户可以选择 http 协议的版本，如 HTTP/1.1、HTTP/2。http 包的多数 API 并不区分这两种协议版本，只有当用户用到某个版本的特有功能时，才需要做这种区分，如 HTTP/1.1 中的 chunked 的 transfer-encoding，HTTP/2 中的 server push。</p>
<p>http 库默认使用 HTTP/1.1 版本。当开发者需要使用 HTTP/2 协议时，需要为 Client/Server 配置 tls，并且设置 alpn 的值为 <code>h2</code>；不支持 HTTP/1.1 通过 <code>Upgrade: h2c</code> 协议升级的方式升级到 HTTP/2。</p>
<p>如果创建 HTTP/2 连接握手失败，Client/Server 会自动将协议退回 HTTP/1.1。</p>
<ul>
<li>
<p>用户通过 <a href="./http_package_api/http_package_classes.html#class-clientbuilder">ClientBuilder</a> 构建一个 Client 实例，构建过程可以指定多个参数，如 httpProxy、logger、cookieJar、是否自动 redirect、连接池大小等。</p>
</li>
<li>
<p>用户通过 <a href="./http_package_api/http_package_classes.html#class-serverbuilder">ServerBuilder</a> 构建一个 Server 实例，构建过程可以指定多个参数，如 addr、port、logger、distributor 等。</p>
</li>
</ul>
<p>用户如果需要自己设置 Logger，需要保证它是线程安全的。</p>
<p>Client、Server 的大多数参数在构建后便不允许修改，如果想要更改，用户需要重新构建一个新的 Client 或 Server 实例；如果该参数支持动态修改，本实现会提供显式的功能，如 Server 端 cert、CA 的热更新。</p>
<ul>
<li>
<p>通过 Client 实例，用户可以发送 http request、接收 http response。</p>
</li>
<li>
<p>通过 Server 实例，用户可以配置 request 转发处理器，启动 http server。在 server handler 中，用户可以通过 HttpContext 获取 client 发来的 request 的详细信息，构造发送给 client 的 response。
Server 端根据 Client 端请求，创建对应的 ProtocolService 实例，同一个 Server 实例可同时支持两种协议：HTTP/1.1、HTTP/2。</p>
</li>
<li>
<p>在 client 端，用户通过 HttpRequestBuilder 构造 request，构建过程可以指定多个参数，如 method、url、version、headers、body、trailers 等等；构建之后的request 不允许再进行修改。</p>
</li>
<li>
<p>在 server 端，用户通过 HttpResponseBuilder 构造 response，构建过程可以指定多个参数，如 status、headers、body、trailers 等等；构建之后的 response 不允许再进行修改。</p>
</li>
</ul>
<p>另外，本实现提供一些工具类，方便用户构造一些常用 response，如 RedirectHandler 构造 redirect response，NotFoundHandler 构造 404 response。</p>
<h3 id="websocket"><a class="header" href="#websocket">WebSocket</a></h3>
<p>本实现为 WebSocket 提供 sub-protocol 协商，包括基础的 frame 解码、读取、消息发送、frame 编码、ping、pong、关闭等功能。</p>
<p>用户通过 WebSocket.upgradeFromClient 从一个 HTTP/1.1 或 HTTP/2 Client 实例升级到 WebSocket 协议，之后通过返回的 WebSocket 实例进行 WebSocket 通讯。</p>
<p>用户在一个 server 端的 handler 中，通过 WebSocket.upgradeFromServer 从 HTTP/1.1 或 HTTP/2 协议升级到 WebSocket 协议，之后通过返回的 WebSocket 实例进行 WebSocket 通讯。</p>
<p>按照协议，HTTP/1.1 中，升级后的 WebSocket 连接是建立在 tcp/tls 连接之上；HTTP/2 中，升级后的 WebSocket 连接是建立在 HTTP/2 connection 的一个 stream 之上。HTTP/1.1 中，close 最终会直接关闭 tcp/tls 连接；HTTP/2 中，close 只会关闭 connection 上的一个 stream。</p>
<h2 id="api-列表"><a class="header" href="#api-列表">API 列表</a></h2>
<h3 id="函数"><a class="header" href="#函数">函数</a></h3>
<div class="table-wrapper"><table><thead><tr><th>函数名</th><th>功能</th></tr></thead><tbody>
<tr><td><a href="./http_package_api/http_package_funcs.html#func-handleerrorhttpcontext-uint16">handleError(HttpContext, UInt16)</a></td><td>便捷的 Http 请求处理函数，用于回复错误请求。</td></tr>
<tr><td><a href="./http_package_api/http_package_funcs.html#func-notfoundhttpcontext">notFound(HttpContext)</a></td><td>便捷的 Http 请求处理函数，用于回复 404 响应。</td></tr>
<tr><td><a href="./http_package_api/http_package_funcs.html#func-upgradehttpcontext">upgrade(HttpContext)</a></td><td>在 handler 内获取 StreamingSocket，可用于支持协议升级和处理 CONNECT 请求。</td></tr>
</tbody></table>
</div>
<h3 id="接口"><a class="header" href="#接口">接口</a></h3>
<div class="table-wrapper"><table><thead><tr><th>接口名</th><th>功能</th></tr></thead><tbody>
<tr><td><a href="./http_package_api/http_package_interfaces.html#interface-cookiejar">CookieJar</a></td><td>Client 用来管理 Cookie 的工具。</td></tr>
<tr><td><a href="./http_package_api/http_package_interfaces.html#interface-httprequestdistributor">HttpRequestDistributor</a></td><td>Http request 分发器接口，将一个 request 按照 url 中的 path 分发给对应的 HttpRequestHandler 处理。</td></tr>
<tr><td><a href="./http_package_api/http_package_interfaces.html#interface-httprequesthandler">HttpRequestHandler</a></td><td>Http request 处理器。</td></tr>
<tr><td><a href="./http_package_api/http_package_interfaces.html#interface-protocolservicefactory">ProtocolServiceFactory</a></td><td>Http 服务实例工厂，用于生成 <code>ProtocolService</code> 实例。</td></tr>
</tbody></table>
</div>
<h3 id="类"><a class="header" href="#类">类</a></h3>
<div class="table-wrapper"><table><thead><tr><th>类名</th><th>功能</th></tr></thead><tbody>
<tr><td><a href="./http_package_api/http_package_classes.html#class-client">Client</a></td><td>Client 类，用户可以通过 Client 实例发送 HTTP/1.1 或 HTTP/2 请求。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-clientbuilder">ClientBuilder</a></td><td>用于 Client 实例的构建，Client 没有公开的构造函数，用户只能通过 ClientBuilder 得到 Client 实例。ClientBuilder 文档中未明确说明支持版本的配置，在 HTTP/1.1 与 HTTP/2 都会生效。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-cookie">Cookie</a></td><td>HTTP 本身是无状态的，server 为了知道 client 的状态，提供个性化的服务，便可以通过 Cookie 来维护一个有状态的会话。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-filehandler">FileHandler</a></td><td>用于处理文件下载或者文件上传。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-funchandler">FuncHandler</a></td><td>HttpRequestHandler 接口包装类，把单个函数包装成 HttpRequestHandler。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-httpcontext">HttpContext</a></td><td>Http 请求上下文，作为 HttpRequestHandler.handle 函数的参数在服务端使用。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-httpheaders">HttpHeaders</a></td><td>用于表示 Http 报文中的 header 和 trailer，定义了相关增、删、改、查操作。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-httprequest">HttpRequest</a></td><td>Http 请求类。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-httprequestbuilder">HttpRequestBuilder</a></td><td>HttpRequestBuilder 类用于构造 HttpRequest 实例。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-httpresponse">HttpResponse</a></td><td>Http 响应类。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-httpresponsebuilder">HttpResponseBuilder</a></td><td>用于构造 HttpResponse 实例。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-httpresponsepusher">HttpResponsePusher</a></td><td>HTTP/2 服务器推送。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-httpresponsewriter">HttpResponseWriter</a></td><td>HTTP response消息体 Writer，支持用户控制消息体的发送过程。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-notfoundhandler">NotFoundHandler</a></td><td>便捷的 Http 请求处理器，<code>404 Not Found</code> 处理器。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-optionshandler">OptionsHandler</a></td><td>便捷的 Http 处理器，用于处理 OPTIONS 请求。固定返回 &quot;Allow: OPTIONS，GET，HEAD，POST，PUT，DELETE&quot; 响应头。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-protocolservice">ProtocolService</a></td><td>Http协议服务实例，为单个客户端连接提供 Http 服务，包括对客户端 request 报文的解析、 request 的分发处理、 response 的发送等。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-redirecthandler">RedirectHandler</a></td><td>便捷的 Http 处理器，用于回复重定向响应。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-server">Server</a></td><td>提供 HTTP 服务的 Server 类。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-serverbuilder">ServerBuilder</a></td><td>提供 Server 实例构建器。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-websocket">WebSocket</a></td><td>提供 WebSocket 服务的相关类，提供 WebSocket 连接的读、写、关闭等函数。用户通过 upgradeFrom 函数以获取 WebSocket 连接。</td></tr>
<tr><td><a href="./http_package_api/http_package_classes.html#class-websocketframe">WebSocketFrame</a></td><td>WebSocket 用于读的基本单元。</td></tr>
</tbody></table>
</div>
<h3 id="枚举"><a class="header" href="#枚举">枚举</a></h3>
<div class="table-wrapper"><table><thead><tr><th>枚举名</th><th>功能</th></tr></thead><tbody>
<tr><td><a href="./http_package_api/http_package_enums.html#enum-filehandlertype">FileHandlerType</a></td><td>用于设置 <code>FileHandler</code> 是上传还是下载模式。</td></tr>
<tr><td><a href="./http_package_api/http_package_enums.html#enum-protocol">Protocol</a></td><td>定义 HTTP 协议类型枚举。</td></tr>
<tr><td><a href="./http_package_api/http_package_enums.html#enum-websocketframetype">WebSocketFrameType</a></td><td>定义 <code>WebSocketFrame</code> 的枚举类型。</td></tr>
</tbody></table>
</div>
<h3 id="结构体"><a class="header" href="#结构体">结构体</a></h3>
<div class="table-wrapper"><table><thead><tr><th>结构体名</th><th>功能</th></tr></thead><tbody>
<tr><td><a href="./http_package_api/http_package_structs.html#struct-httpstatuscode">HttpStatusCode</a></td><td>用来表示网页服务器超文本传输协议响应状态的 3 位数字代码。</td></tr>
<tr><td><a href="./http_package_api/http_package_structs.html#struct-servicepoolconfig">ServicePoolConfig</a></td><td>Http Server 协程池配置。</td></tr>
<tr><td><a href="./http_package_api/http_package_structs.html#struct-transportconfig">TransportConfig</a></td><td>传输层配置类，服务器建立连接使用的传输层配置。</td></tr>
</tbody></table>
</div>
<h3 id="异常类"><a class="header" href="#异常类">异常类</a></h3>
<div class="table-wrapper"><table><thead><tr><th>异常类名</th><th>功能</th></tr></thead><tbody>
<tr><td><a href="./http_package_api/http_package_exceptions.html#class-connectionexception">ConnectionException</a></td><td>Http 的tcp连接异常类。</td></tr>
<tr><td><a href="./http_package_api/http_package_exceptions.html#class-coroutinepoolrejectexception">CoroutinePoolRejectException</a></td><td>Http 的协程池拒绝请求处理异常类。</td></tr>
<tr><td><a href="./http_package_api/http_package_exceptions.html#class-httpexception">HttpException</a></td><td>Http 的通用异常类。</td></tr>
<tr><td><a href="./http_package_api/http_package_exceptions.html#class-httpstatusexception">HttpStatusException</a></td><td>Http 的响应状态异常类。</td></tr>
<tr><td><a href="./http_package_api/http_package_exceptions.html#class-httptimeoutexception">HttpTimeoutException</a></td><td>Http 的超时异常类。</td></tr>
<tr><td><a href="./http_package_api/http_package_exceptions.html#class-websocketexception">WebSocketException</a></td><td>WebSocket 的通用异常类。</td></tr>
</tbody></table>
</div>
                    </main>

                    <nav class="nav-wrapper" aria-label="Page navigation">
                        <!-- Mobile navigation buttons -->
                            <a rel="prev" href="../../logger/logger_samples/logger_sample.html" class="mobile-nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                                <i class="fa fa-angle-left"></i>
                            </a>

                            <a rel="next prefetch" href="../../net/http/http_package_api/http_package_funcs.html" class="mobile-nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                                <i class="fa fa-angle-right"></i>
                            </a>

                        <div style="clear: both"></div>
                    </nav>
                </div>
            </div>

            <nav class="nav-wide-wrapper" aria-label="Page navigation">
                    <a rel="prev" href="../../logger/logger_samples/logger_sample.html" class="nav-chapters previous" title="Previous chapter" aria-label="Previous chapter" aria-keyshortcuts="Left">
                        <i class="fa fa-angle-left"></i>
                    </a>

                    <a rel="next prefetch" href="../../net/http/http_package_api/http_package_funcs.html" class="nav-chapters next" title="Next chapter" aria-label="Next chapter" aria-keyshortcuts="Right">
                        <i class="fa fa-angle-right"></i>
                    </a>
            </nav>

        </div>




        <script>
            window.playground_copyable = true;
        </script>


        <script src="../../elasticlunr.min.js"></script>
        <script src="../../mark.min.js"></script>
        <script src="../../searcher.js"></script>

        <script src="../../clipboard.min.js"></script>
        <script src="../../cangjie-highlight-export.js"></script><script src="../../highlight.js"></script>
        <script src="../../book.js"></script>

        <!-- Custom JS scripts -->
        
        <script src="../../cangjie-highlight-export.js"></script><script src="../../highlight.js"></script>
        <script src="../../assets/elasticlunr.js"></script>
        <script src="../../assets/fzf.umd.js"></script>
        <script src="../../assets/sidebar.js"></script>


    </div>
    </body>
</html>
